﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Web.Configuration;
using System.ServiceModel;
using BookClubIt.Processor;
using DTO = BookClubIt.DTO;
using System.Web.UI.HtmlControls;


namespace BookClubIt.UserControls
{
    public partial class accountmenu : BaseUserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
           DTO.Member member = MemberProcessorInstance.GetMemberById(CurrentUserId);
           imguserAvatar.ImageUrl = "../avatars/" + member.AvatarURL;

    
     //       lnkBookshelf.NavigateUrl = "~/Account/bookshelf.aspx";
            lnkMyAccount.NavigateUrl = "~/Account/default.aspx";
            lnkChangePassword.NavigateUrl = "~/Account/ChangePassword.aspx";
            lnkMyClubs.NavigateUrl = "~/Account/mybookclubs.aspx";
            lnkInbox.NavigateUrl = "~/Account/inbox.aspx";
         //   lnkFriends.NavigateUrl = "~/Account/friends.aspx";


            string CurrentUri = Page.Request.Url.AbsoluteUri;

           
             if (CurrentUri.Contains("default.aspx"))
            {
                liMyAccount.Attributes.Add("class", "active");
                Page.Title = "My Account | Bookclubit.com";
            }
            else if (CurrentUri.Contains("ChangePassword.aspx"))
            {
                liChangePassword.Attributes.Add("class", "active");
                Page.Title = "Change Password | Bookclubit.com";
            }
            else if (CurrentUri.Contains("mybookclubs.aspx"))
            {
                liMyBookClubs.Attributes.Add("class", "active");
                Page.Title = "My Book Clubs | Bookclubit.com";
            }
            else if (CurrentUri.Contains("inbox.aspx"))
            {
                liInbox.Attributes.Add("class", "active");
                Page.Title = "Inbox | Bookclubit.com";
            }
            //else if (CurrentUri.Contains("friends.aspx"))
            //{
            //    liFriends.Attributes.Add("class", "active");
            //    Page.Title = "Friends | Bookclubit.com";
            //}
         
        }
    }
}